package com.oocl.euc.core.builder;

import com.oocl.euc.core.requestform.model.RequestPostmortem;
import com.oocl.euc.core.requestform.model.RequestPostmortemAttach;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class RequestPostmortemBuilder {

    private RequestPostmortem requestPostmortem;

    public RequestPostmortemBuilder defaultBuilder() {

        requestPostmortem = new RequestPostmortem();
        requestPostmortem.setProblem("Request Postmortem Problem");
        requestPostmortem.setAttendee("attendee");
        requestPostmortem.setBusinessImpact("businessImpact");
        requestPostmortem.setCorrectAction("correctAction");
        requestPostmortem.setPreventiveAction("preventiveAction");
        requestPostmortem.setRootCause("rootCause");
        return this;
    }

    public RequestPostmortemBuilder withAttachment(List<RequestPostmortemAttach> requestPostmortemAttachList){

        this.requestPostmortem.setPostmortemAttach(requestPostmortemAttachList);
        return this;
    }

    public RequestPostmortem create(){
        return this.requestPostmortem;
    }
}
